package com.wang.madness.exception;

import com.wang.madness.customEnum.ResultCode;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author DanielWu
 */
@Getter
public class ApiRuntimeException extends RuntimeException {

  private final int code;

  private final String msg;

  public ApiRuntimeException () {
    this(ResultCode.SERVER_ERROR.getCode(), ResultCode.SERVER_ERROR.getMsg());
  }

  public ApiRuntimeException (String msg) {
    this(ResultCode.SERVER_ERROR.getCode(), msg);
  }

  public ApiRuntimeException (int code, String msg) {
    super(msg);
    this.code = code;
    this.msg = msg;
  }

}
